#ifndef unigame_TimerEvent_h
#define unigame_TimerEvent_h

#include "config/Def.h"

namespace unigame
{
    class ITimerCallBack;
    class TimerEvent
    {
    public:
        TimerEvent(int32u nextTime, ITimerCallBack* callBack, int32u loopTime = -1, int32u iden = 0):
        m_nextTime(nextTime),
        m_callBack(callBack),
        m_loopTime(loopTime),
        m_id(iden),
		m_isDeleted(false)
        {
        }
        
        ~TimerEvent()
        {
        }

		void deleteSelf()
		{
			m_isDeleted = true;
			m_loopTime = -1;
		}
    
    public:
        int64u m_targetTime;
        int32u m_nextTime;
        int32u m_loopTime;
        ITimerCallBack* m_callBack;
        int32u m_id;
		bool m_isDeleted;
    };
}

#endif
